﻿@model KPIS.GERP.Models.ICM.RequestParcel

@{
    ViewBag.Title = "แก้ไขรายการขอเบิก [RP]";
}


@using (Html.BeginForm("Edit", "RequestParcel", FormMethod.Post, new { id = "form", @class = "form-horizontal" }))
{
    @Html.AntiForgeryToken()

    <div class="block-button-menu-above">

        @Html.ButtonViewAll()
        @Html.ButtonSubmit()

    </div>
    @Html.HiddenFor(model => model.ReqParcelId)
    @Html.HiddenFor(model => model.IcmReqCode)
    @Html.HiddenFor(model => model.ProjectId)
    @Html.HiddenFor(model => model.WarehousePermitId)
    @Html.HiddenFor(model => model.RecordStatus)
    @Html.HiddenFor(model => model.CreatedBy)
    @Html.HiddenFor(model => model.IcmResItemCode)
    @Html.HiddenFor(model => model.IcmResTypeId)
    @Html.HiddenFor(model => model.ApprovedBy)
    @Html.HiddenFor(model => model.ApprovedDate)
    @Html.HiddenFor(model => model.Reason)

    @Html.HiddenFor(model => model.WarehousePermit.JobSiteId)
    @Html.HiddenFor(model => model.WarehousePermit.RecordStatus)
    @Html.HiddenFor(model => model.WarehousePermit.CreatedBy)
    @Html.HiddenFor(model => model.WarehousePermit.CreatedWhen)
    @Html.HiddenFor(model => model.WarehousePermit.UpdatedBy)
    @Html.HiddenFor(model => model.WarehousePermit.UpdatedWhen)
    @Html.HiddenFor(model => model.WarehousePermit.WhId)
    @Html.HiddenFor(model => model.WarehousePermit.WarehousePermitId)

    @Html.HiddenFor(model => model.WarehousePermit.Warehouse.WhId)
    @Html.HiddenFor(model => model.WarehousePermit.Warehouse.Name)
    @Html.HiddenFor(model => model.WarehousePermit.Warehouse.Description)
    @Html.HiddenFor(model => model.WarehousePermit.Warehouse.ScopeId)
    @Html.HiddenFor(model => model.WarehousePermit.Warehouse.JobSiteId)
    @Html.HiddenFor(model => model.WarehousePermit.Warehouse.RecordStatus)
    @Html.HiddenFor(model => model.WarehousePermit.Warehouse.CreatedBy)
    @Html.HiddenFor(model => model.WarehousePermit.Warehouse.CreatedWhen)
    @Html.HiddenFor(model => model.WarehousePermit.Warehouse.UpdatedBy)
    @Html.HiddenFor(model => model.WarehousePermit.Warehouse.UpdatedWhen)
    
    @Html.HiddenFor(model => model.Project.ProjId)
    @Html.HiddenFor(model => model.Project.AltProjId)
    @Html.HiddenFor(model => model.Project.Code)
    @Html.HiddenFor(model => model.Project.CreatedBy)
    @Html.HiddenFor(model => model.Project.CreatedWhen)
    @Html.HiddenFor(model => model.Project.DateEnd)
    @Html.HiddenFor(model => model.Project.DateStart)
    @Html.HiddenFor(model => model.Project.Description)
    @Html.HiddenFor(model => model.Project.GfmisCode)
    @Html.HiddenFor(model => model.Project.JobSiteId)
    @Html.HiddenFor(model => model.Project.JobSiteIdMain)
    @Html.HiddenFor(model => model.Project.Name)
    @Html.HiddenFor(model => model.Project.ProjectDate)
    @Html.HiddenFor(model => model.Project.ProjectObject)
    @Html.HiddenFor(model => model.Project.ProjectPlan)
    @Html.HiddenFor(model => model.Project.ProjectReasons)
    @Html.HiddenFor(model => model.Project.ProjectRemarks)
    @Html.HiddenFor(model => model.Project.ProjectScope)
    @Html.HiddenFor(model => model.Project.ProjectTarget)
    @Html.HiddenFor(model => model.Project.ProjectTypeId)
    @Html.HiddenFor(model => model.Project.ProjMngId)
    @Html.HiddenFor(model => model.Project.RecordStatus)
    @Html.HiddenFor(model => model.Project.StratListId)
    @Html.HiddenFor(model => model.Project.UpdatedBy)
    @Html.HiddenFor(model => model.Project.UpdatedWhen)
    @Html.HiddenFor(model => model.Project.BgYear)
    

    @Html.ValidationSummary(true)
    @Html.Partial("_EditorForm")   
}


@section scripts {

<script type="text/javascript" >

    $('.date-picker').datepicker({ language: 'th-th', format: 'dd/mm/yyyy' });

    $("#txtReqCode").attr("disabled", "disabled");


    $(function () {
        $("form").submit(function (e) {
            e.preventDefault();
            var currentForm = this;
            bootbox.confirm
                ('ต้องการบันทึกข้อมูลใช่หรือไม่', function (result) {
                    if (result) {
                        currentForm.submit();
                    }
                });
        });
    });

    
    </script>
}
